package com.example.demo.sys.role.dao;

import com.example.demo.base.BaseDao;
import com.example.demo.sys.role.entity.SysRole;
import com.example.demo.sys.role.entity.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author haocj
 * 用户dao
 */
@Mapper
public interface SysRoleMenuDao extends BaseDao<SysRoleMenu> {

    /**
     * 批量新增
     *
     * @param list
     */
    @Transactional(readOnly = false, rollbackFor = Exception.class)
    void save(List<SysRoleMenu> list);

    /**
     * 批量删除
     *
     * @param ids
     */
    @Transactional(readOnly = false, rollbackFor = Exception.class)
    void delete(@Param("ids") String[] ids);

    /**
     * 根据id集合删除
     *
     * @param rid
     */
    @Transactional(readOnly = false, rollbackFor = Exception.class)
    void deleteById(@Param("rid") String rid);

    /**
     * in查询
     *
     * @param ids
     * @return
     */
    List<SysRoleMenu> findRoleMenuList(@Param("list") List<String> ids);

}
